package com.example.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.example.pojo.Belaidup;
import com.example.pojo.BillAccount;
import com.example.service.BillAccountService;
import com.example.service.publi;
import com.example.vo.PageBean;

@Controller
public class PayableController {
	@Autowired
	private publi p1;
	@Autowired
	private BillAccountService billAccountService;
	@RequestMapping("/yingfu")
	public String index(){
		return "yinfuchongkuan";
	}
	@RequestMapping("/billAccountAll")
	@ResponseBody
	public Object billAccountAll(int begin){
		return this.billAccountService.billAccountAll(begin,1);
	}
	@RequestMapping("/addAccount")
	@ResponseBody
	public String addAccount(@RequestBody BillAccount billAccount){
		System.out.println(billAccount);
		return "保存成功";
	}
	/**
	 * 按供应商编号查询
	 * @return
	 */
	@RequestMapping("/findBelaidupByNo")
	@ResponseBody
	public List<Belaidup> findBelaidupByNo(String custID){
		System.out.println(custID);
		return this.billAccountService.findBelaidupByno(custID);
	}
	@RequestMapping("/danhao")
	@ResponseBody
	public String danhao(String date){
		return p1.danhao(date, "billAccount", "BillAccountID");
	}
}
